VDCompressDone
TheVDCompressDone
function allows an application to determine whether the video digitizer has finished digitizing and compressing a frame of image data. An application starts the digitizing process by calling theVDCompressOneFrameAsync
function, which was just discussed.
pascal VideoDigitizerError VDCompressDone (VideoDigitizerComponent ci, Boolean *done, Ptr *theData, long *dataSize, unsigned char *similarity, TimeRecord *t);
ci
- Identifies the application's connection to the video digitizer component. An application obtains this value from the Component Manager's
OpenComponent
function.done
- Contains a pointer to a Boolean value. Applications set this value to
true
when they are done, and set it tofalse
if the operation is incomplete.theData
- Contains a pointer to a field that is to receive a pointer to the compressed image data. The digitizer returns a pointer that is valid in the application's current memory mode.
- The digitizer allocates the memory into which it places the digitized data. An application must call the
VDReleaseCompressBuffer
function to dispose of this memory; this function is discussed next.dataSize
- Contains a pointer to a field to receive a value indicating the number of bytes of compressed image data.
similarity
- Contains a pointer to a field to receive an indication of the relative similarity of this image to the previous image in a sequence. A value of 0 indicates that the current frame is a key frame in the sequence. A value
of 255 indicates that the current frame is identical to the previous frame. Values from 1 through 254 indicate relative similarity, ranging from very different (1) to very similar (254). This field is only filled in if the temporal quality passed in with theVDSetCompression
function (described on page 8-44) is not 0--that is, if it is not frame-differenced.t
- Contains a pointer to a time record. When the operation is complete, the digitizer fills in this structure with information indicating when the frame was grabbed. The time value stored in this structure is in the time base that the application sets with the
VDSetTimeBase
function (see page 8-51 for more information about this function). The format and content of this structure are discussed in the chapter "Movie Toolbox" in Inside Macintosh: QuickTime.DESCRIPTION
An application can determine when the digitizer is done with the frame by calling theVDCompressDone
function. When the digitizer is done, it sets the Boolean value referred to by thedone
parameter totrue
, and then returns information about the digitized and compressed frames via thetheData
,dataSize
,similarity
, andt
parameters.If the digitizer is not yet done, it sets the Boolean value to
false
. In this case, the digitizer does not return any other information.Note that the digitizer is careful to return the frames in temporal order, and to avoid returning two frames with the same time value (unless the rate is set to 0).
RESULT CODES
noErr 0 No error digiUnimpErr -2201 Function not supported SEE ALSO
Applications must use theVDReleaseCompressBuffer
function to free the memory that contains the compressed image data. This function is described in the next section.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help